<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>absolute和relative定位</title>
  <style>
    .relative {
      width: 500px;
      height: 500px;
      border: 1px solid #ccc;
      /* position: relative; */
      top: 300px;
      left: 300px;
    }
    .absolute {
      width: 200px;
      height: 200px;
      border: 1px solid #000;
      position: absolute;
      top: 70px;
      left: 30px;
    }
  </style>
</head>
<body>
  absolute和relative定位
  1.relative 依据自身定位
  2.absolute 依据最近一层的定位元素定位

  <div class="relative">
    <div class="absolute"></div>
  </div>

  
</body>
</html>